<template>
	<MkBillList ref='drawerRef'>
		<MkQueryContainer>
			<template #header="">
				<MkForm ref="queryForm" :model="searchParam" :inline="true">
					<MkInput label="关键字" @keyup.enter.native="search" v-model="searchParam.keyword" clearable="" />
					<el-form-item>
						<MkButtonQuery @click="search"> </MkButtonQuery>
					</el-form-item>
				</MkForm>
			</template>
			<MkTable :data="tableData" v-loading="loading" @row-dblclick="edit">
				<MkColumn label="单号" prop="id" />
				<MkColumn label="单据状态" prop="danJuZhuangTai" />
				<MkColumn label="创建时间" prop="createTime" />
				<MkColumn label="创建人" prop="createUserName" />
			</MkTable>
			<MkPagination v-model:page="searchParam.page" v-model:pageSize="searchParam.pageSize" :total="total"
				@query="search" />
		</MkQueryContainer>
	</MkBillList>
</template>

<script lang='ts' setup>
// 输血申请--列表
import { TraShenQingApi, TraShenQingPageOutput } from '/@/api/tra/TraShenQing';
import { usePageQuery } from '/@/hooks'

const drawerRef = ref();
const emits = defineEmits(['load'])

const { searchParam, total, tableData, loading, search } = usePageQuery<TraShenQingPageOutput>(TraShenQingApi.page)

onMounted(() => {
	search();
})

const open = async () => {
	drawerRef.value.show();
};

const edit = (row: any) => {
	drawerRef.value?.close();
	emits('load', row)
}

defineExpose({ open })

</script>

<style lang='scss' scoped></style>